//导入vue-router
import { createRouter, createWebHistory } from 'vue-router'
//导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'
import ArticleCategoryVue from '@/views/article/ArticleCategory.vue'
import ArticleManageVue from '@/views/article/ArticleManage.vue'
import UserInfoVue from '@/views/user/UserInfo.vue'
import UserAvatarVUe from '@/views/user/UserAvatar.vue'
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'
import AIvue from '@/views/AI/index.vue'
import MapVue from '@/views/boat/map.vue'
import SensorVue from '@/views/boat/sensor.vue'
import MonitorVue from '@/views/boat/monitor.vue'
import Index from '@/views/Index.vue'
import Solar from '@/views/boat/solar.vue'
const routes = [
    { path: '/login', component: LoginVue },
    {
        path: '/',
        component: LayoutVue,
        //重定向
        redirect: '/index',
        //子路由
        children: [
            { path: '/index', component: Index },
            { path: '/article/category', component: ArticleCategoryVue },
            { path: '/article/manage', component: ArticleManageVue },
            { path: '/user/info', component: UserInfoVue },
            { path: '/user/avatar', component: UserAvatarVUe },
            { path: '/user/password', component: UserResetPasswordVue },
            { path: '/AI', component: AIvue },
            { path: '/solar', component: Solar },
            {path: '/boat/map', component: MapVue,},
            {path: '/boat/sensor', component: SensorVue,},
            {path: '/boat/monitor',component: MonitorVue,}
        ]
    }
]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
});

export default router